package summary;

/**
 * @Author: 海琳琦
 * @Date: 2022/3/7 9:39
 * https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/
 */
public class Title26 {


    public int removeDuplicates(int[] nums) {
        int left = 0;
        for (int right = 1; right < nums.length; right++) {
            if (nums[left] != nums[right]) {
                left++;
                nums[left] = nums[right];
            }
        }
        return left;
    }

    public static void main(String[] args) {

    }
}
